﻿@model Models.UserModels.Plan

@{
    string planType = ViewBag.PlanType;
    var date = Model.StartDate;
}
<div>
    <blockquote class="col-lg-2 ">
        <h3>详细</h3>
    </blockquote>

    <div class="col-xs-3  pull-right text-right">

        <a class="btn" data-ajax="true" data-ajax-method="Delete" data-ajax-mode="replace" data-ajax-update="#Main" href="@Url.Action("Index", null, new { PlanType = planType, date  })"><i class="fa fa-chevron-left"></i>&nbsp;@lang.Back</a>

        @if (Model.Finish)
        {
            <a class="btn btn-success" data-ajax="true" data-ajax-method="Delete" data-ajax-mode="replace" data-ajax-update="#Main" href="@Url.Action("Delete", new { type = "Finish", PlanType = planType, Model.Id,date })"><i class="fa fa-check"></i>&nbsp;已完成</a>
        }
        else
        {
            <span>&nbsp;</span>
            <a class="btn btn-info" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#Main" href="@Url.Action("Edit", new { Model.Id, PlanType = planType, date })"><i class="fa fa-edit"></i>&nbsp;@lang.Edit</a>

            <span>&nbsp;</span>
            <a class="btn btn-danger" data-ajax="true" data-ajax-confirm="您确定要删除该记录吗？该操作不可恢复！" data-ajax-method="Delete" data-ajax-mode="replace" data-ajax-update="#Main" href="@Url.Action("Delete", new { type = "Delete", PlanType = planType, Model.Id, date })"><i class="fa fa-times"></i>&nbsp;@lang.Delete</a>

            <span>&nbsp;</span>
            <a class="btn btn-primary" data-ajax="true" data-ajax-method="Delete" data-ajax-mode="replace" data-ajax-update="#Main" href="@Url.Action("Delete", new { type = "Finish", PlanType = planType, Model.Id, date })"><i class="fa fa-check"></i>&nbsp;@lang.Finish</a>
        }
    </div>
    <hr />
</div>
<div>
    @foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForDisplay && !pm.ModelType.IsAbstract && !ViewData.TemplateInfo.Visited(pm)).OrderBy(a => a.Order))
    {
        <dl class="dl-horizontal">
            <dt>
                @Html.Label(prop.DisplayName)
            </dt>
            <dd>
                @Html.Display(prop.PropertyName)
            </dd>
        </dl>
    }
</div>